{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
	<li class="active">
		<a href="#tab_basic">添加激活码</a>
	</li>
	<li>
		<a href="#tab_notice">导入激活码</a>
	</li>
</ul>
<div class="app-content">
	<div class="app-form">
			<div class="tab-content">
				<div class="tab-pane active" id="tab_basic">
					<form action="#" method="post" class="form-horizontal form">
						<div class="panel panel-default">
							<div class="panel-heading">基本信息</div>
							<div class="panel-body">
								<div class="form-group">
									<label class="col-sm-2 control-label">激活码时长</label>
									<div class="col-sm-9">
										<div class="input-group">
											<input type="text" name="days" class="form-control" placeholder="请输入时长" />
											<span class="input-group-addon">天</span>
										</div>
									</div>
								</div>
                                {if file_exists(IA_ROOT . '/addons/'.MODULE_NAME.'/pTLjC21GjCGj.log')}
                                    <!--某个用户定制的开通一卡通时赠送金额功能-->
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">赠送金额</label>
                                        <div class="col-sm-9">
                                            <div class="input-group">
                                                <input type="text" name="give_price" class="form-control" placeholder="请输入赠送金额" />
                                                <span class="input-group-addon">￥</span>
                                            </div>
                                            <span class="help-block">用户使用当前激活码所赠送的金额</span>
                                        </div>
                                    </div>
                                {/if}
								<div class="form-group">
									<label class="col-sm-2 control-label">创建个数</label>
									<div class="col-sm-9">
										<input type="text" name="num" class="form-control" placeholder="创建个数" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">适用代理</label>
									<div class="col-sm-9">
										<select name="aid" style="width: 100%;" class="select2">
											<option value="0" >总后台</option>
											{loop $agents $agent}
											<option value="{$agent['id']}">{$agent['agentname']}</option>
											{/loop}
										</select>
									</div>
								</div>
								{if file_exists(PATH_MODULE . 'lsh.log')}
								<div class="form-group">
									<label class="col-sm-2 control-label">所属挪车代理</label>
									<div class="col-sm-9">
										<select name="caraid" style="width: 100%;">
											<option value="0" selected="selected">总平台</option>
											{loop $caragents $caragent}
											<option value="{$caragent['id']}">{$caragent['agentname']}</option>
											{/loop}
										</select>
									</div>
								</div>
								{/if}
								<div class="form-group">
									<label class="col-sm-2 control-label">匹配等级</label>
									<div class="col-sm-9">
										<select name="levelid" style="width: 100%;">
											<option value="0" >{$delevel['name']}</option>
											{loop $levels $level}
											<option value="{$level['id']}">{$level['name']}</option>
											{/loop}
										</select>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">激活码前缀</label>
									<div class="col-sm-9">
										<input type="text" name="prefix" class="form-control" placeholder="激活码前缀" />
										<span class="help-block">可以用于区分不同商家的激活码</span>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">激活码备注</label>
									<div class="col-sm-9">
										<input type="text" name="remark" class="form-control" placeholder="请输入激活码备注" />
									</div>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-9">
								<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
								<input type="hidden" name="token" value="{$_W['token']}" />
							</div>
						</div>
					</form>
				</div>
				<div class="tab-pane active" id="tab_notice" style="display: none;">
					<form action="{php echo web_url('halfcard/halfcode/csv_add')}" enctype="multipart/form-data" method="post" class="form-horizontal form">
						<div class="panel panel-default">
							<div class="panel-heading">基本信息</div>
							<div class="panel-body">
								<div class="form-group uploade">
									<label class="col-sm-2 control-label">上传文件：</label>
									<div class="col-sm-9">
										<input class="form-control"  name="csv_file" type="file" value="">
										<span class="help-block">请<a href="{URL_MODULE}web/resource/download/activationcode.csv" target="_blank">点此下载样例文件</a></span>
									</div>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label"></label>
							<div class="col-sm-9">
								<input name="submit" type="submit" class="btn btn-primary min-width"  value="上传">
							</div>
						</div>
					</form>
				</div>
			</div>
	</div>
</div>
<script>
	$(function() {
		window.optionchanged = false;
		$('#myTab a').click(function(e) {
			e.preventDefault(); //阻止a链接的跳转行为
			$(this).tab('show'); //显示当前选中的链接及关联的content
			$("#tab_notice").show();
		})
	});
</script>
{php include wl_template('common/footer');}